How to: Create a query from an existing query.
Solution:
Click the 'Queries' tab in the Database window, click 'New', and select 'Design View' from the list box.
1) If the Database window is not active, activate the Database window.
2) Click the 'Queries' tab in the Database window.
Queries tab
3) Click 'New'. (The New Query dialog box appears.)
4) Select 'Design View' in the 'New Query' list box.
5) Click 'OK'. (The Show Table dialog box appears.)
6) Click the 'Queries' tab.
7) Select the desired query to be used to create a new query from the list box.
8) Click 'Add'. (The selected query appears behind the dialog box.)
9) (Optional) Repeat steps 7) and 8) for each additional query.
10) Click 'Close' to close the 'Show Table' dialog box.
11) (Optional) If there are multiple tables in the query, they must be joined together:
NOTE: If there are default relationships already defined between any of the tables, Access automatically displays their join lines. Access can also automatically create joins between two fields with the same name and data type in two different tables (but only if one of the fields is a primary key).
a) Click on the primary key field in one table.
b) Drag the primary key field from that table on top of the foreign key field table to which it is to be joined.
NOTE: The foreign key field in the second table must be the same data type as the primary key field in the first table.
c) Release the mouse button. (A join line appears from the first table to the second table, with a '1' at the first table and an infinity sign at the second table, designating a one-to-many relationship.)
12) To add fields to the query:
a) Select a field from a table's field list in the top half of the Query Design window.
b) Drag the field to the desired column of the design grid in the bottom half of the Query Design window.
Design grid
c) Release the mouse button. (The field name appears in the Field row, and its table appears in the Table row.)
Field row and Table row
d) Repeat steps 12)a) through 12)c) for each field to be added to the query.
NOTE: Fields can also be added to the query by selecting a field from the drop-down list in the 'Field' row of the design grid in the bottom half of the Query Design window.
Design grid
13) Select the 'Query' menu and select 'Run'. (The results appear in the Query Grid.)
14) Select the 'File' menu and select 'Save' to save the query.
15) Type the name for the query in the 'Save As' box.
16) Click 'OK'.
17) Select the 'File' menu and select 'Close' to close the query.